package com.lxp.tksys.common;


//基于ThreadLocal封装工具类，保存和获取id
public class BaseContext {

    private static ThreadLocal<Long> threadLocal=new ThreadLocal<>();

    //将id保存到当前线程中
    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }

    public static Long getCurrentId(){
        return threadLocal.get();
    }

}


